import mitt from 'mitt';
import {
  productNotifyProperties,
  deepProductNotifyProperties,
  tasksProperties,
  deleteTaskProperties
} from '@main/socket/type';

export type MittEvents = {
  'product-handle-reply': { product_id: number } & (
    | productNotifyProperties
    | deepProductNotifyProperties
  );
  'receive-task': tasksProperties;
  'delete-task': deleteTaskProperties;
};

export const emitter = mitt<MittEvents>();
